package com.situ.mall.common.controller;

import com.situ.mall.common.service.IAttachmentService;
import com.situ.mall.common.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;

@Controller
@RequestMapping("/attachment")
public class AttachmentController {


    @Autowired
    private IAttachmentService attachmentService;

    @PostMapping("/upload")
    @ResponseBody
    public ResultVO upload(MultipartFile file) {
        return attachmentService.upload(file);
    }



}
